package com.my.home.common.scan;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.ControllerAdvice;


/**
 * Controller advice to translate the server side exceptions to client-friendly json structures.
 */
@ControllerAdvice
public class ExceptionTranslator {
	private static final Logger LOGGER= LogManager.getLogger(ExceptionTranslator.class);
	/**
	 * 普通的异常交给 {@link ExceptionResolver} 处理
	 * 兼容 页面 异常和ajax异常
	 */
//	@ExceptionHandler(Exception.class)
//	@ResponseBody
//	public Map<String,Object> processException(Exception ex) {
//		LOGGER.error(ex.getMessage(), ex);
//		return RespJson.failure(ex.getMessage());
//	}
}
